package cn.iocoder.yudao.module.system.dal.mysql.userordermanage;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.userordermanage.UserOrderManageDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.userordermanage.vo.*;

/**
 * 订单管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserOrderManageMapper extends BaseMapperX<UserOrderManageDO> {

    default PageResult<UserOrderManageDO> selectPage(UserOrderManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserOrderManageDO>()
                .eqIfPresent(UserOrderManageDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(UserOrderManageDO::getMoney, reqVO.getMoney())
                .eqIfPresent(UserOrderManageDO::getSource, reqVO.getSource())
                .eqIfPresent(UserOrderManageDO::getIp, reqVO.getIp())
                .likeIfPresent(UserOrderManageDO::getPackageName, reqVO.getPackageName())
                .eqIfPresent(UserOrderManageDO::getDiscount, reqVO.getDiscount())
                .eqIfPresent(UserOrderManageDO::getCoupons, reqVO.getCoupons())
                .eqIfPresent(UserOrderManageDO::getPackageId, reqVO.getPackageId())
                .eqIfPresent(UserOrderManageDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(UserOrderManageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserOrderManageDO::getId));
    }

}